
# Flags and compilers

F90 = gfortran -fbounds-check
FCFLAGS = -fdefault-real-8 -fdefault-integer-8 -c -m64 
LDFLAGS = -fdefault-real-8 -fdefault-integer-8 -L/usr/local/fftw/fftw-2.1.5/lib -lfftw -lm -m64


# Program name
PROG    = vmd.x

# modules - if using FFTW
MODULES =  dimensions.o parameters.o fftw_wrap.o fft_3d.o efield.o evolve.o

# modules - if using IMSL
#MODULES = dimensions.o parameters.o imsl_wrap.o efield.o evolve.o

# Objects
OBJ     = set_space_vectors.o read_input.o set_ic.o \
          write_derived.o diagnostics.o advect.o vmd.o



# -------------------------------------------------------
# link

$(PROG):  $(MODULES) $(OBJ)
	$(F90) $(MODULES) $(OBJ) -o $(PROG) $(LDFLAGS)
# -------------------------------------------------------
# compile

$(OBJ): $(MODULES) 

%.o: %.f
	$(F90) $(FCFLAGS) $<

%.o: %.f90
	$(F90) $(FCFLAGS) $<

clean:
	rm -f *~ *.o *.mod $(PROG)

